#!/bin/bash
export TZ="UTC"
host=`uname -a`
echo $host

# 定义文件路径
proxy_file=$(realpath ~/.proxy.sh)
chromium_path=$(realpath $(dirname ${BASH_SOURCE[0]}))/../../
depot_tools_path=$workspace/depot_tools
gclient_path=$chromium_path/src/v8/third_party/ninja/

# example for use extra_flags: PBC_RUNNER=xxx bash run_114.sh "--cache"
extra_flags=$1
echo "_______________extra_flags:${extra_flags}"
set -e
# pbc test
# if [[ ${host} == *"aarch64"* ]]; then
#   ./tools/dev/gm.py arm64.release aot d8
# else
#   ./tools/dev/gm.py x64.release aot d8
# fi
v8_path=$(realpath $(dirname ${BASH_SOURCE[0]}))
bash $v8_path/CI/build_dcheck_d8.sh

#bash $v8_path/CI/test.sh hermes release true  #hermes release(x64/arm)

echo "--------------test------------------"
#start=$(date +%s)
#bash -e CI/run_bench.sh
#end=$(date +%s)
#echo "Elapsed time: $((end - start)) seconds"
echo "-------------- test 262 ------------------"
bash CI/run-test262.sh false "${extra_flags}"
echo "------------- hermes test -----------------"
bash CI/run-hermes.sh false "${extra_flags}" 
echo "------------- intl test -----------------"
bash CI/run-intl.sh false "${extra_flags}"
echo "------------- mjsunit test -----------------"
bash CI/run-mjsunit.sh false "${extra_flags}"
echo "------------- message test -----------------"
bash CI/run-message.sh false "${extra_flags}"
echo "------------- webkit test -----------------"
bash CI/run-webkit.sh false "${extra_flags}"